js get first element by class

95

js get first element by class -

var elements = document.getElementsByClassName('className');
var requiredElement = elements[0];

Comments

Submit
0 Comments